﻿@model IssueIT.WebUI.Models.DashboardViewModel

@{
    ViewBag.Title = "Home";
}

<div class="title-block">
<h2>Projects</h2>
<span style="float:left; padding:5px 15px; font-size:75%;" >
<a href="@Url.Action("addproject", "admin")" class="small-button"><span id="upload-button" class="add">@Resources.Labels.AddProject</span></a>
</span>
<div style="clear:both;"></div>
</div>

<div class="dashboard-table">
<table cellpadding="0" cellspacing="0">
<tr>
<th class="right-border">project</th>
<th colspan="4" class="right-border">open issues</th>
<th></th>
</tr>
<tr>
<td class="sub-heading right-border"></td>
<td class="sub-heading">mine</td>
<td class="sub-heading">uncovred</td>
<td class="sub-heading">unassinged</td>
<td class="sub-heading right-border">all</td>
<td class="sub-heading"></td>
</tr>

@for(int i=0; i<Model.List.Count(); i++) { 
	var project = Model.List.ElementAt(i);
<tr class="odd@(i%2==0)">
<td style="width:150px;padding: 15px 20px;" class="right-border"><a href="@Url.Action("Index", "Project", new { project = project.UriName })">@project.Title</a></td>
<td class="issue-count"><a href="@Url.Action("Index", "Project", new { project = project.UriName, type = "open", filter = "current" })">@if (project.OpenIssues.CurrentUser != 0){ @project.OpenIssues.CurrentUser;}</a></td>
<td class="issue-count"><a href="@Url.Action("Index", "Project", new { project = project.UriName, type = "open", filter = "uncovred" })">@if (project.OpenIssues.Uncovred != 0){ @project.OpenIssues.Uncovred;}</a></td>		
<td class="issue-count"><a href="@Url.Action("Index", "Project", new { project = project.UriName, type = "open", filter = "unassigned" })">@if (project.OpenIssues.Unassigned != 0){ @project.OpenIssues.Unassigned;}</a></td>
<td class="issue-count right-border"><a href="@Url.Action("Index", "Project", new {project = project.UriName, type = "open", filter = "all" })">@if (project.OpenIssues.All != 0){ @project.OpenIssues.All;}</a></td>
<td style="padding:0 20px;"><a class="small-button no-background" href="@Url.Action("Add", "Issue", new { project = project.UriName })"><span class="add">add issue</span></a></td>
</tr>
}

</table>
</div>